#!/usr/bin/env jruby

require 'test/unit'
dir = File.dirname(__FILE__)
require File.join(dir, '..', '..', 'lib', 'monkey', 'time')

########################################

class TestTimeToS < Test::Unit::TestCase
  def test_should_return_string
    assert_kind_of String, Time.now.to_s
  end
  
  def test_should_output_in_decent_format
    pattern = /^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$/
    assert_match pattern, Time.local(2007, 'jan',  8,  8).to_s, '1-digit'
    assert_match pattern, Time.local(2007, 'nov', 23, 23).to_s, '2-digit'
    assert_match pattern, Time.now.to_s, 'now'
  end
end
